<template>
	<div>
		<label>我要打分：</label><input v-model.number="starnumber">
        <label>	星星总数：</label><input v-model.number="stars">
        <Star :starnum='starnum' :stars='stars' @input='changenum'></Star>
	</div>
</template>

<script>
	import Star from '../components/Star'
	export default{
		data:function(){
			return{
				starnumber:5,
            	stars:5,
			}
        },
        computed:{
            starnum:function(){
                if(this.starnumber>this.stars){
                    return this.stars
                }else{
                    return this.starnumber
                }
            }
        },
        methods:{
            changenum:function(n){
                this.starnumber = n
            }
        },
        components:{
        	Star,
        }
	}
</script>

<style>
	
</style>